package gapidt.common;

public class StringUtils {
	
	public static final String SEPARATOR = ";";
	
	public static String capitalizeFirstLetter(String str){
		if(str != null && str.length() > 0)
			return str.substring(0, 1).toUpperCase()+str.substring(1);
		return str;
	}
	
	public static String[] splitAndTrim(String str){
		if(str != null){
			String[] strArray = org.apache.commons.lang3.StringUtils.split(str, SEPARATOR);
			for(int i = 0; i < strArray.length; i++){
				strArray[i] = strArray[i].trim();
			}
			return strArray;
		}else{
			return new String[]{};
		}
	}
	
	public static String join(String[] strArray){
		return org.apache.commons.lang3.StringUtils.join(strArray, SEPARATOR+" ");
	}
}
